<div id='bank'>
    <div class='panel panel-default'>
        <div class='panel-heading'>红包</div>
        <div class='panel-body'></div>
    </div>
    <dl>
        <dd>
            <div class="input-group">
                <span class='input-group-addon'>输入红包码:</span>
                <input type='text' id='txtl' class='form-control' placeholder='输入红包码'/>
            </div>
        </dd>
        <dd class='text-center'>
            <input type='button' id='btnPack' class='btn btn-danger' value='获取红包'/>
        </dd>
    </dl>
</div>
<div class='panel panel-default'>
    <div class='panel-heading'>领取记录</div>
    <div class='panel-body'>
        <table class='table table-striped table-hover table-bordered'>

            <tr>
                <td>领取时间</td>
                <td>领取宝币</td>
                <td>领取状态</td>
            </tr>

            <?php if(is_array($list))  foreach($list as $v) { ?>
                <tr>

                    <td><?php echo date('Y-m-d H:i:s',$v->time);?></td>
                    <td><?php echo isset($v->ledou)?$v->ledou:"";?></td>
                    <td>已领取</td>
                </tr>
            <?php }?>
        </table>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#btnPack").bind('click',function () {
            var l=parseInt($("#txtl").val());
            if(isNaN(l)){
                alert('请输入正确的代码');
                return;
            }
            $.getJSON('b.php?c=user&a=get_pack&num='+l,function (data) {
                alert(data.message);
                if(data.status==0)location.reload();
            })
        })
    })
</script>